package com.example.androidtest;

import com.example.BaseActivity;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class BroadCastTestActivity extends BaseActivity {

	public TextView textView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_broad_cast_test);

		textView = (TextView) findViewById(R.id.textBroadcastRecv);
		Button button = (Button) findViewById(R.id.btnBroadcastSend);
		button.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View view) {
				Intent intent = new Intent("com.jinisu.test.broadcast.CUSTOMER");
				intent.addCategory("com.jinisu.test");
				intent.putExtra("data", "customer broadcast message!");
				sendBroadcast(intent);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.broad_cast_test, menu);
		return true;
	}

}
